import React, { Component } from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import GlobalNav from '@/components/base/GlobalNav';
import Footer from '@/components/base/Footer';
// import WorksTop from '@/components/works/works-base/WorksTop';
// import WorksNav from '@/components/works/works-base/WorksNav';
import LastUpload from './child/LastUpload';
import Popular from './child/Popular';
import Best from './child/Best';
import Update from './child/Update';
import AllUpdate from './child/AllUpdate';
class Com extends Component {
  constructor (props) {
    super(props);
    this.state = {
      // list:[
      //   {
      //     path: '/works/lastUpload',
       //   },
      //   {
      //     path: '/works/popular',
      //     name: '正在流行'
      //   },
      //   {
      //     path: '/works/best',
      //     name: '24小时最佳'
      //   }
      // ]
    }
  }

  render () {
    return (
      <div className = "container">
        <div className="header">
          <GlobalNav />
         </div>
        <div className="section">
          {/* <WorksTop />*/}
          {/* <WorksNav 
          list = { this.state.list }
          />  */}
          <Switch>
            <Route path = "/works/lastUpload" component = { LastUpload } />
            <Route path = "/works/popular" component = { Popular } />
            <Route path = "/works/best" component = { Best } />
            <Route path = "/works/update" component = { Update } />
            <Route path = "/works/allupdate" component = { AllUpdate } />
            <Redirect from = "/works" to = "/works/update"/>
          </Switch>
        </div>
        <div className="foot">
          <Footer />
        </div>
      </div>
    )
  }
}

export default Com;
